﻿using System;
using System.Buffers;

namespace eNets.IO.Binary;

public interface IBinaryWriter
{
    int WritableLength
    {
        get;
    }

    Span<byte> Mark(int size);
    
    void WriteBoolean(bool value);
    
    void WriteInt8(sbyte value);
    void WriteUInt8(byte value);
    
    void WriteInt16LE(short value);
    void WriteInt16BE(short value);
    
    void WriteUInt16LE(ushort value);
    void WriteUInt16BE(ushort value);
    
    void WriteInt32LE(int value);
    void WriteInt32BE(int value);
    
    void WriteUInt32LE(uint value);
    void WriteUInt32BE(uint value);
    
    void WriteInt64LE(long value);
    void WriteInt64BE(long value);
    
    void WriteUInt64LE(ulong value);
    void WriteUInt64BE(ulong value);
    
    void WriteFloat32LE(float value);
    void WriteFloat32BE(float value);
    
    void WriteFloat64LE(double value);
    void WriteFloat64BE(double value);
    
    void WriteChar(char value);
    void WriteCharLE(char value);
    void WriteCharBE(char value);
    
    void WriteString(string value);

    void WriteSpan(in ReadOnlySpan<byte> span);
    void WriteSequence(in ReadOnlySequence<byte> sequence);
}